/*  1:   */ package org.jetbrains.jps.model.artifact.impl.elements;
/*  2:   */ 
/*  3:   */

import org.jetbrains.annotations.NotNull;
import org.jetbrains.jps.model.JpsElementChildRole;
import org.jetbrains.jps.model.artifact.JpsArtifact;
import org.jetbrains.jps.model.artifact.JpsArtifactReference;
import org.jetbrains.jps.model.artifact.elements.JpsArtifactOutputPackagingElement;
import org.jetbrains.jps.model.artifact.elements.JpsArtifactRootElement;
import org.jetbrains.jps.model.artifact.elements.JpsCompositePackagingElement;
import org.jetbrains.jps.model.artifact.elements.JpsPackagingElement;
import org.jetbrains.jps.model.artifact.elements.ex.JpsComplexPackagingElementBase;
import org.jetbrains.jps.model.ex.JpsElementChildRoleBase;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */
/* 11:   */
/* 12:   */
/* 13:   */
/* 14:   */
/* 15:   */
/* 16:   */
/* 17:   */ 
/* 18:   */ public class JpsArtifactOutputPackagingElementImpl
/* 19:   */   extends JpsComplexPackagingElementBase<JpsArtifactOutputPackagingElementImpl>
/* 20:   */   implements JpsArtifactOutputPackagingElement
/* 21:   */ {
/* 22:39 */   private static final JpsElementChildRole<JpsArtifactReference> a = JpsElementChildRoleBase.create("artifact reference");
/* 23:   */   
/* 24:   */   public JpsArtifactOutputPackagingElementImpl(@NotNull JpsArtifactReference paramJpsArtifactReference)
/* 25:   */   {
/* 26:42 */     this.myContainer.setChild(a, paramJpsArtifactReference);
/* 27:   */   }
/* 28:   */   
/* 29:   */   private JpsArtifactOutputPackagingElementImpl(JpsArtifactOutputPackagingElementImpl paramJpsArtifactOutputPackagingElementImpl)
/* 30:   */   {
/* 31:46 */     super(paramJpsArtifactOutputPackagingElementImpl);
/* 32:   */   }
/* 33:   */   
/* 34:   */   @NotNull
/* 35:   */   public JpsArtifactOutputPackagingElementImpl createCopy()
/* 36:   */   {
/* 37:52 */     void tmp8_5 = new JpsArtifactOutputPackagingElementImpl(this);
/* 38:52 */     if (tmp8_5 == null) {
/* 39:52 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/artifact/impl/elements/JpsArtifactOutputPackagingElementImpl", "createCopy" }));
/* 40:   */     }
/* 41:52 */     return tmp8_5;
/* 42:   */   }
/* 43:   */   
/* 44:   */   @NotNull
/* 45:   */   public JpsArtifactReference getArtifactReference()
/* 46:   */   {
/* 47:58 */     JpsArtifactReference tmp13_10 = ((JpsArtifactReference)this.myContainer.getChild(a));
/* 48:58 */     if (tmp13_10 == null) {
/* 49:58 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/artifact/impl/elements/JpsArtifactOutputPackagingElementImpl", "getArtifactReference" }));
/* 50:   */     }
/* 51:58 */     return tmp13_10;
/* 52:   */   }
/* 53:   */   
/* 54:   */   public List<JpsPackagingElement> getSubstitution()
/* 55:   */   {
/* 56:63 */     JpsArtifact localJpsArtifact = (JpsArtifact)getArtifactReference().resolve();
/* 57:64 */     if (localJpsArtifact == null) {
/* 58:64 */       return Collections.emptyList();
/* 59:   */     }
/* 60:65 */     JpsCompositePackagingElement localJpsCompositePackagingElement = localJpsArtifact.getRootElement();
/* 61:66 */     if ((localJpsCompositePackagingElement instanceof JpsArtifactRootElement)) {
/* 62:67 */       return new ArrayList(localJpsCompositePackagingElement.getChildren());
/* 63:   */     }
/* 64:70 */     return Collections.singletonList(localJpsCompositePackagingElement);
/* 65:   */   }
/* 66:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.jps.model.artifact.impl.elements.JpsArtifactOutputPackagingElementImpl

 * JD-Core Version:    0.7.0.1

 */